"use strict";
cc._RF.push(module, 'be1c30xd9JD8LXxChVzuknF', '_UserMoveToResultHandler');
// CustomResultHandler/_UserMoveToResultHandler.js

"use strict";

// @import
var mod_Global = require("../_Global");

var CHeroAction = require("../CHeroAction"); // @export


module.exports = {
  /** @override */
  handle: function handle(oUserMoveToResult) {
    if (!oUserMoveToResult) {
      return;
    }

    var nMoveUserId = oUserMoveToResult.moveUserId;

    if (!nMoveUserId) {
      console.error("用户 Id 无效");
      return;
    }

    if (nMoveUserId == mod_Global.myUserId) {
      // 如果是自己就不要移动了,
      return;
    } // 获取英雄节点


    var oHeroNode = mod_Global.heroMap[nMoveUserId.toString()];

    if (null == oHeroNode) {
      console.error("\u82F1\u96C4\u8282\u70B9\u4E3A\u7A7A, moveUserId = " + nMoveUserId);
      return;
    }

    var nPosX_0 = oUserMoveToResult.moveFromPosX;
    var nPosY_0 = oUserMoveToResult.moveFromPosY;
    var nPosX_1 = oUserMoveToResult.moveToPosX;
    var nPosY_1 = oUserMoveToResult.moveToPosY;
    var nMoveStartTime = oUserMoveToResult.moveStartTime;
    console.log("\u82F1\u96C4\u79FB\u52A8, moveUserId = " + nMoveUserId + ", posX_0 = " + nPosX_0 + ", posY_0 = " + nPosY_0 + ", posX_1 = " + nPosX_1 + ", posY_1 = " + nPosY_1); // 执行高级移动

    oHeroNode.getComponent(CHeroAction).moveToAdv(nPosX_0, nPosY_0, nPosX_1, nPosY_1, nMoveStartTime);
  }
};

cc._RF.pop();